import request from "api";

export function getAllEquip(page){
    return request({
        url:"Devices/getAllDevices",
        method:"get",
        params:{
            PageIndex:page.index,
            PageSize:page.PageSize
        }
    })
}

export function deleteEquip(Id){
    return request({
        method:"delete",
        url:"Devices/delete",
        params:{
            Id
        }
    })
}

export function addEquip(form){
    return request({
        url:"Devices/add",
        method:"post",
        //headers: {'Content-Type': 'multipart/form-data'},
        data:{
            name:form.Name,
            document:form.DocumentPath,
            src:form.srcPath
        }
    })
}

export function file(form){
    return request({
        method:"post",
        headers: {'Content-Type': 'multipart/form-data'},
        url:"Devices/upload",
        // params:{
        //     Id
        // },
        data:form
    })
}

export function editEquip(form){
    return request({
        method:"post",         
        // headers: {'Content-Type': 'multipart/form-data'},
        url:"Devices/modify",
        data:{
            Id:form.Id,
            name:form.Name,
            document_path:form.DocumentPath,
            src_path:form.SrcPath
        }
    })
}

